/* 
 * File:   taskmanger.h
 * Author: Administrator
 */

#ifndef TASKMANGER_H
#define	TASKMANGER_H

#include "stdint.h"
#include "wdog.h"
#include "common.h"

#define __STATIC_INLINE  static __inline

#define OS_PRIO_MAX           64
#define OS_LIST_LOW_PRIO      0
#define OS_LIST_HIGH_PRIO     1
#define OS_TASK_STATE_SLEEP   0
#define OS_TASK_STATE_ACTIVE  1

	typedef struct OST_CB
	{
		uint8_t  Priority;
		uint8_t  TaskSt; 
		struct OST_CB * NextTask;
		void (*TaskPtr)(void);
	} OS_TCB;

	
void OSInit(void);	
void OSTaskCreat(OS_TCB *TaskTCB, uint8_t Prio, void (*TaskPtr)(void));	
void OSTaskDel(OS_TCB *TaskTCB);
void OSRun(void);	
void OSTaskPend(OS_TCB *TCB);
void OSTaskPost(OS_TCB *TCB);	
	
#ifdef	__cplusplus
extern "C" {
#endif



#ifdef	__cplusplus
}
#endif

#endif	/* TASK_H */

